﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="clr-namespace:Coding4Fun.Toolkit.Controls">

    <ControlTemplate x:Key="DisabledChatBubbleTextBoxTemplate" TargetType="TextBox">
		<ContentControl 
			x:Name="ContentElement" 
			BorderThickness="0" 
			Margin="{TemplateBinding Margin}"
			HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
			Padding="{TemplateBinding Padding}" 
			VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
	</ControlTemplate>

	<Style TargetType="local:ChatBubbleTextBox">
		<Setter Property="FontFamily" Value="{StaticResource FontFamilySegoeNormal}"/>
		<Setter Property="FontSize" Value="{StaticResource DefaultFontSizeMediumLarge}"/>
		<Setter Property="Background" Value="{StaticResource DefaultTextBoxBrush}"/>
		<Setter Property="Foreground" Value="{StaticResource DefaultTextBoxForegroundBrush}"/>
		<Setter Property="BorderBrush" Value="{StaticResource DefaultTextBoxBrush}"/>
		<Setter Property="BorderThickness" Value="{StaticResource DefaultBorderThickness}"/>
		<Setter Property="Padding" Value="7, 4, 0, 4"/>
		
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
		<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
		
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:ChatBubbleTextBox">
					<Grid>
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="ChatBubbleDirectionStates">
								<VisualState x:Name="UpperRight">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="UpperRightPath">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="UpperLeft">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="UpperLeftPath">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="LowerRight">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="LowerRightPath">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="LowerLeft">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="LowerLeftPath">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BackgroundElement">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxDisabledBackgroundThemeBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxDisabledBorderThemeBrush}"/>
										</ObjectAnimationUsingKeyFrames>

										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxDisabledForegroundThemeBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Normal">
									<Storyboard>
										<DoubleAnimation Duration="0" To="{StaticResource TextControlBackgroundThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement"/>
										<DoubleAnimation Duration="0" To="{StaticResource TextControlBorderThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BorderElement"/>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="PointerOver">
									<Storyboard>
										<DoubleAnimation Duration="0" To="{StaticResource TextControlPointerOverBackgroundThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement"/>
										<DoubleAnimation Duration="0" To="{StaticResource TextControlPointerOverBorderThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BorderElement"/>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Focused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultAccentBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="ButtonStates">
								<VisualState x:Name="ButtonVisible">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DeleteButton">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="ButtonCollapsed"/>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>

						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition Height="Auto" />
							<RowDefinition Height="Auto" />
						</Grid.RowDefinitions>
						<Grid Grid.Row="1">
							<Grid.Resources>
								<Style x:Name="DeleteButtonStyle" TargetType="Button">
									<Setter Property="Template">
										<Setter.Value>
											<ControlTemplate TargetType="Button">
												<Grid>
													<VisualStateManager.VisualStateGroups>
														<VisualStateGroup x:Name="CommonStates">
															<VisualState x:Name="Normal"/>
															<VisualState x:Name="PointerOver">
																<Storyboard>
																	<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BackgroundElement">
																		<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPointerOverBackgroundThemeBrush}"/>
																	</ObjectAnimationUsingKeyFrames>
																	<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
																		<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPointerOverBorderThemeBrush}"/>
																	</ObjectAnimationUsingKeyFrames>
																	<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="GlyphElement">
																		<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPointerOverForegroundThemeBrush}"/>
																	</ObjectAnimationUsingKeyFrames>
																</Storyboard>
															</VisualState>
															<VisualState x:Name="Pressed">
																<Storyboard>
																	<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BackgroundElement">
																		<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPressedBackgroundThemeBrush}"/>
																	</ObjectAnimationUsingKeyFrames>
																	<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
																		<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPressedBorderThemeBrush}"/>
																	</ObjectAnimationUsingKeyFrames>
																	<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="GlyphElement">
																		<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPressedForegroundThemeBrush}"/>
																	</ObjectAnimationUsingKeyFrames>
																</Storyboard>
															</VisualState>
															<VisualState x:Name="Disabled">
																<Storyboard>
																	<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement"/>
																	<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BorderElement"/>
																</Storyboard>
															</VisualState>
														</VisualStateGroup>
													</VisualStateManager.VisualStateGroups>
													<Border 
															Name="BorderElement" 
															BorderBrush="{StaticResource TextBoxButtonBorderThemeBrush}" 
															BorderThickness="{TemplateBinding BorderThickness}"/>
													<Border 
															Name="BackgroundElement" 
															Background="{StaticResource TextBoxButtonBackgroundThemeBrush}" 
															Margin="{TemplateBinding BorderThickness}">
														<TextBlock 
																Name="GlyphElement" 
																Foreground="{StaticResource TextBoxButtonForegroundThemeBrush}" 
																FontFamily="{StaticResource SymbolThemeFontFamily}" 
																HorizontalAlignment="Center" 
																Text="&#xE0A4;" 
																VerticalAlignment="Center"/>
													</Border>
												</Grid>
											</ControlTemplate>
										</Setter.Value>
									</Setter>
								</Style>
							</Grid.Resources>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="Auto"/>
							</Grid.ColumnDefinitions>

							<Border 
									Name="BackgroundElement" 
									Background="{TemplateBinding Background}" 
									Margin="{TemplateBinding BorderThickness}"
									Grid.ColumnSpan="2" />
							<Border 
									Name="BorderElement" 
									Background="Transparent"
									BorderBrush="{TemplateBinding BorderBrush}" 
									BorderThickness="{TemplateBinding BorderThickness}" 
									Grid.ColumnSpan="2" />

							<TextBlock 
									Opacity="0"
									Text="{TemplateBinding Text}" 
									Margin="{TemplateBinding BorderThickness}" 
									Padding="{TemplateBinding Padding}"
									/>

							
							<ScrollViewer 
									Name="HintContentElement" 
									Foreground="{StaticResource DefaultTextBoxReadOnlyBrush}"
									Content="{TemplateBinding Hint}" 
									HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" 
									HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" 
									IsTabStop="False" 
									IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" 
									IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" 
									IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" 
									Margin="{TemplateBinding BorderThickness}" 
									Padding="{TemplateBinding Padding}" 
									VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
									VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" 
									ZoomMode="Disabled" />
							<ScrollViewer 
									Name="ContentElement" 
									HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" 
									HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" 
									IsTabStop="False" 
									IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" 
									IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" 
									IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" 
									Margin="{TemplateBinding BorderThickness}" 
									Padding="{TemplateBinding Padding}" 
									VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
									VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" 
									ZoomMode="Disabled" />
							<Button 
									Name="DeleteButton" 
									Style="{StaticResource DeleteButtonStyle}" 
									BorderThickness="{TemplateBinding BorderThickness}" 
									FontSize="{TemplateBinding FontSize}" 
									IsTabStop="False" 
									Visibility="Collapsed" 
									VerticalAlignment="Stretch"
									Grid.Column="1" />
						</Grid>
						<Path 
							Name="LowerRightPath"
							Data="M0,0 L1,1 L1,0 "
							Grid.Row="2"
							Fill="{Binding ElementName=BorderElement, Path=BorderBrush}"
							Opacity="{Binding ElementName=BorderElement, Path=Opacity}"
							Stretch="Fill"
							Margin="12,0"
							Height="12"
							Width="18"
							Visibility="Collapsed"
							HorizontalAlignment="Right"
							VerticalAlignment="Top" />
						<Path 
							Name="LowerLeftPath"
							Data="M0,0 L0,1 L1,0"
							Grid.Row="2"
							Fill="{Binding ElementName=BorderElement, Path=BorderBrush}"
							Opacity="{Binding ElementName=BorderElement, Path=Opacity}"
							Stretch="Fill"
							Margin="12,0"
							Height="12"
							Width="18"
							Visibility="Collapsed"
							HorizontalAlignment="Left"
							VerticalAlignment="Top"/>
						<Path 
							Name="UpperLeftPath"
							Data="M0,0 L1,1 L0,1 "
							Grid.Row="0"
							Fill="{Binding ElementName=BorderElement, Path=BorderBrush}"
							Opacity="{Binding ElementName=BorderElement, Path=Opacity}"
							Stretch="Fill"
							Margin="12,0"
							Height="12"
							Width="18"
							Visibility="Collapsed"
							HorizontalAlignment="Left"
							VerticalAlignment="Bottom" />
						<Path 
							Name="UpperRightPath"
							Data="M0,1 L1,1 L1,0 "
							Grid.Row="0"
							Fill="{Binding ElementName=BorderElement, Path=BorderBrush}"
							Opacity="{Binding ElementName=BorderElement, Path=Opacity}"
							Stretch="Fill"
							Margin="12,0"
							Height="12"
							Width="18"
							Visibility="Collapsed"
							HorizontalAlignment="Right"
							VerticalAlignment="Bottom" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>

<!--<Grid Background="Transparent" Margin="{TemplateBinding Margin}">
	<VisualStateManager.VisualStateGroups>
		<VisualStateGroup x:Name="CommonStates">
			<VisualState x:Name="Normal"/>
			<VisualState x:Name="MouseOver"/>
			<VisualState x:Name="Disabled">
				<Storyboard>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="EnabledBorder">
						<DiscreteObjectKeyFrame KeyTime="0">
							<DiscreteObjectKeyFrame.Value>
								<Visibility>Collapsed</Visibility>
							</DiscreteObjectKeyFrame.Value>
						</DiscreteObjectKeyFrame>
					</ObjectAnimationUsingKeyFrames>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledOrReadonlyBorder">
						<DiscreteObjectKeyFrame KeyTime="0">
							<DiscreteObjectKeyFrame.Value>
								<Visibility>Visible</Visibility>
							</DiscreteObjectKeyFrame.Value>
						</DiscreteObjectKeyFrame>
					</ObjectAnimationUsingKeyFrames>

					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="LowerRightPath">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}"/>
					</ObjectAnimationUsingKeyFrames>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="LowerLeftPath">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}"/>
					</ObjectAnimationUsingKeyFrames>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="UpperRightPath">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}"/>
					</ObjectAnimationUsingKeyFrames>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="UpperLeftPath">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}"/>
					</ObjectAnimationUsingKeyFrames>

				</Storyboard>
			</VisualState>
			<VisualState x:Name="ReadOnly">
				<Storyboard>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="EnabledBorder">
						<DiscreteObjectKeyFrame KeyTime="0">
							<DiscreteObjectKeyFrame.Value>
								<Visibility>Collapsed</Visibility>
							</DiscreteObjectKeyFrame.Value>
						</DiscreteObjectKeyFrame>
					</ObjectAnimationUsingKeyFrames>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledOrReadonlyBorder">
						<DiscreteObjectKeyFrame KeyTime="0">
							<DiscreteObjectKeyFrame.Value>
								<Visibility>Visible</Visibility>
							</DiscreteObjectKeyFrame.Value>
						</DiscreteObjectKeyFrame>
					</ObjectAnimationUsingKeyFrames>

					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DisabledOrReadonlyBorder">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultTextBoxBrush}"/>
					</ObjectAnimationUsingKeyFrames>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="DisabledOrReadonlyBorder">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultTextBoxBrush}"/>
					</ObjectAnimationUsingKeyFrames>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DisabledOrReadonlyContent">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultTextBoxReadOnlyBrush}"/>
					</ObjectAnimationUsingKeyFrames>
				</Storyboard>
			</VisualState>
		</VisualStateGroup>
		<VisualStateGroup x:Name="FocusStates">
			<VisualState x:Name="Focused">
				<Storyboard>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="EnabledBorder">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultTextBoxEditBackgroundBrush}"/>
					</ObjectAnimationUsingKeyFrames>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="EnabledBorder">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultTextBoxEditBorderBrush}"/>
					</ObjectAnimationUsingKeyFrames>

					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="LowerRightPath">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultTextBoxEditBorderBrush}"/>
					</ObjectAnimationUsingKeyFrames>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="LowerLeftPath">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultTextBoxEditBorderBrush}"/>
					</ObjectAnimationUsingKeyFrames>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="UpperRightPath">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultTextBoxEditBorderBrush}"/>
					</ObjectAnimationUsingKeyFrames>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="UpperLeftPath">
						<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultTextBoxEditBorderBrush}"/>
					</ObjectAnimationUsingKeyFrames>
				</Storyboard>
			</VisualState>
			<VisualState x:Name="Unfocused"/>
		</VisualStateGroup>
		<VisualStateGroup x:Name="ChatBubbleDirectionStates">
			<VisualState x:Name="UpperRight">
				<Storyboard>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="UpperRightPath">
						<DiscreteObjectKeyFrame KeyTime="0">
							<DiscreteObjectKeyFrame.Value>
								<Visibility>Visible</Visibility>
							</DiscreteObjectKeyFrame.Value>
						</DiscreteObjectKeyFrame>
					</ObjectAnimationUsingKeyFrames>
				</Storyboard>
			</VisualState>
			<VisualState x:Name="UpperLeft">
				<Storyboard>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="UpperLeftPath">
						<DiscreteObjectKeyFrame KeyTime="0">
							<DiscreteObjectKeyFrame.Value>
								<Visibility>Visible</Visibility>
							</DiscreteObjectKeyFrame.Value>
						</DiscreteObjectKeyFrame>
					</ObjectAnimationUsingKeyFrames>
				</Storyboard>
			</VisualState>
			<VisualState x:Name="LowerRight">
				<Storyboard>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="LowerRightPath">
						<DiscreteObjectKeyFrame KeyTime="0">
							<DiscreteObjectKeyFrame.Value>
								<Visibility>Visible</Visibility>
							</DiscreteObjectKeyFrame.Value>
						</DiscreteObjectKeyFrame>
					</ObjectAnimationUsingKeyFrames>
				</Storyboard>
			</VisualState>
			<VisualState x:Name="LowerLeft">
				<Storyboard>
					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="LowerLeftPath">
						<DiscreteObjectKeyFrame KeyTime="0">
							<DiscreteObjectKeyFrame.Value>
								<Visibility>Visible</Visibility>
							</DiscreteObjectKeyFrame.Value>
						</DiscreteObjectKeyFrame>
					</ObjectAnimationUsingKeyFrames>
				</Storyboard>
			</VisualState>
		</VisualStateGroup>
	</VisualStateManager.VisualStateGroups>

	<Grid.RowDefinitions>
		<RowDefinition Height="Auto" />
		<RowDefinition Height="Auto" />
		<RowDefinition Height="Auto" />
	</Grid.RowDefinitions>

	<Border 
		x:Name="EnabledBorder" 
		Grid.Row="1"
		Padding="{TemplateBinding Padding}"
		BorderThickness="{TemplateBinding BorderThickness}" 
		BorderBrush="{TemplateBinding BorderBrush}"
		Background="{TemplateBinding Background}">
		<Grid>
			<ContentControl
				x:Name="HintContentElement"
				BorderThickness="0" 
				Background="Transparent"
				Margin="{StaticResource DefaultTextBoxInnerMargin}"
				HorizontalContentAlignment="Stretch"
				VerticalContentAlignment="Stretch"
				Foreground="{StaticResource DefaultTextBoxReadOnlyBrush}"
				Content="{TemplateBinding Hint}" />
			<ContentControl 
				x:Name="ContentElement" 
				BorderThickness="0" 
				Background="Transparent"
				Margin="{StaticResource DefaultTextBoxInnerMargin}"
				HorizontalContentAlignment="Stretch"
				VerticalContentAlignment="Stretch" />

		</Grid>
	</Border>

	<Border 
		x:Name="DisabledOrReadonlyBorder" 
		Grid.Row="1"
		Padding="{TemplateBinding Padding}"	
		BorderThickness="{TemplateBinding BorderThickness}" 
		BorderBrush="{StaticResource DefaultDisabledBrush}" 
		Visibility="Collapsed">
		<TextBox 
			x:Name="DisabledOrReadonlyContent"
			Background="Transparent"
			Foreground="{StaticResource DefaultDisabledBrush}"
			IsReadOnly="True"
			HorizontalContentAlignment="Stretch"
			VerticalContentAlignment="Stretch"
			TextAlignment="{TemplateBinding TextAlignment}" 
			TextWrapping="{TemplateBinding TextWrapping}" 
			Text="{TemplateBinding Text}" 
			Template="{StaticResource DisabledChatBubbleTextBoxTemplate}" />
	</Border>

	<Path 
		Name="LowerRightPath"
		Data="M0,0 L1,1 L1,0 "
		Grid.Row="2"
		Fill="{TemplateBinding BorderBrush}"
		Stretch="Fill"
		Margin="12,0"
		Height="12"
		Width="18"
		Visibility="Collapsed"
		HorizontalAlignment="Right" />
	<Path 
		Name="LowerLeftPath"
		Data="M0,0 L0,1 L1,0"
		Grid.Row="2"
		Fill="{TemplateBinding BorderBrush}"
		Stretch="Fill"
		Margin="12,0"
		Height="12"
		Width="18"
		Visibility="Collapsed"
		HorizontalAlignment="Left" />
	<Path 
		Name="UpperLeftPath"
		Data="M0,0 L1,1 L0,1 "
		Grid.Row="0"
		Fill="{TemplateBinding BorderBrush}"
		Stretch="Fill"
		Margin="12,0"
		Height="12"
		Width="18"
		Visibility="Collapsed"
		HorizontalAlignment="Left" />
	<Path 
		Name="UpperRightPath"
		Data="M0,1 L1,1 L1,0 "
		Grid.Row="0"
		Fill="{TemplateBinding BorderBrush}"
		Stretch="Fill"
		Margin="12,0"
		Height="12"
		Width="18"
		Visibility="Collapsed"
		HorizontalAlignment="Right" />

</Grid>-->